<template>
    <h2>调整用户积分</h2>
    <table border="1">
        <tr>
            <td>
                积分<input type="text" v-model="score" />
            </td>
        </tr>
        <tr>
            <td>
                备注<textarea rows="3" v-model="remark"></textarea>
            </td>
        </tr>
        <tr>
            <td>
                <input type="button" value="确定" @click="changeScore" />
            </td>
        </tr>
    </table>
</template>

<script setup lang="ts">
 import {ref,onMounted} from 'vue'
    import {useRouter} from 'vue-router'
    const router=useRouter();
    import axios from 'axios'
    import { useMemberStore } from '../../store';
    const useStore=useMemberStore();
    const score=ref("");
    const remark=ref("");
    const changeScore=()=>{
        axios.get('https://localhost:7292/api/Member/InfoChangeScore',{
            params:{
                mid:useStore.mid,
                score:score.value,
                remark:remark.value
            }
        })
        .then(res=>{
            if(res.data>0)
            {
                alert('修改成功');
                router.push('/showInfo');
            }
            else
            {
                alert('修改失败');
            }
        })
    }
</script>

